package com.cg.design.graphicdesignpattern.observer;

/**
 * 表示以数字形式显示观察到的数值，实现了Observer接口
 *
 * @program: LeetCode->DigitObserver
 * @description: 表示以数字形式显示观察到的数值，实现了Observer接口
 * @author: cg
 * @create: 2022-03-29 21:37
 **/
public class DigitObserver implements Observer {
    @Override
    public void update(NumberGenerator generator) {
        System.out.println("DigitObserver:" + generator.getNumber());
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
